//
//  CycleTableViewCell.m
//  SheShiDu
//
//  Created by 单剑秋 on 16/6/12.
//  Copyright © 2016年 单剑秋. All rights reserved.
//

#import "CycleTableViewCell.h"

@implementation CycleTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backView = [[UIView alloc]init];
        _backView.layer.masksToBounds = YES;
        [self.contentView addSubview:_backView];
        
        self.cycleView = [[SDCycleScrollView alloc]init];
        _cycleView.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated;
        _cycleView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
        _cycleView.pageControlDotSize = CGSizeMake(7, 7);
        _cycleView.autoScrollTimeInterval = 3;
        [_cycleView adjustWhenControllerViewWillAppera];
        _cycleView.placeholderImage = [UIImage imageNamed:@"tu0"];
        [_backView addSubview:_cycleView];
        
    
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _backView.frame = CGRectMake( -SCREEN_WIDTH * 1.5 , -SCREEN_WIDTH * 3 - (SCREEN_WIDTH - SCREEN_HEIGHT * (420 / 1334.0)), SCREEN_WIDTH * 4, SCREEN_WIDTH * 4 );

    _cycleView.frame = CGRectMake(SCREEN_WIDTH * 1.5, SCREEN_WIDTH * 3 + (SCREEN_WIDTH - self.contentView.frame.size.height - SCREEN_HEIGHT * (42 / 1334.0)), SCREEN_WIDTH, self.contentView.frame.size.height + SCREEN_HEIGHT * (42 / 1334.0));
    _backView.layer.cornerRadius = SCREEN_WIDTH * 2;
    

    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
